<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::group(['middleware'=>['web','aao' , 'web.auth'],'prefix'=>'home'],function(){
    Route::post('/login','IndexController@login');

    //文章接口
    Route::any('/cate','ArticleController@cate');
    Route::any('/articleList','ArticleController@articleList');
    Route::any('/articleDetail','ArticleController@articleDetail');

    //会员接口
    Route::any('/memberList','MemberController@memberList');
    Route::any('/memberInfo','MemberController@memberInfo');

    Route::get('/current' , 'MemberController@getCurrentUserInfo');

    Route::get('/message/list/{form}/{to}' , 'MemberController@getMessage');
    Route::post('/message/add' , 'MemberController@addMessage');

    Route::get('/friend/{uid}' , 'MemberController@getFriendList');

});


Route::group(['middleware'=>['web','aao']],function(){
    //微信登录
    Route::any('/login' , 'LoginController@login');
    Route::any('/call-back/login' , 'LoginController@callbackLogin');
    Route::any('/wechat' , 'WechatController@server');

    Route::get('/getJsSdk' , 'WechatController@getJsSdk');
});